<div class="container">
	
    <div class="page-title ui-widget-content ui-corner-all head">
	    <div class="headLeft">
        	<h1 class="icon-category">Manager SEO</h1>
        </div>
    	<div class="headRight">
       		
            	
                
        <div class="button float-right">
	         <a class="btn ui-state-default" href="<?php echo base_url('admin/meta/edit/1') ?>"><span class="ui-icon ui-icon-circle-plus"></span>
               Meta Trang chủ</a>
                 <a class="btn ui-state-default" href="<?php echo base_url('admin/meta/edit/2') ?>"><span class="ui-icon ui-icon-circle-plus"></span>
                Meta Tỉnh thành</a>
            <a class="btn ui-state-default" href="<?php echo base_url('admin/meta/edit/') ?>"><span class="ui-icon ui-icon-circle-plus"></span>
                Meta Chuyên mục</a>
               
       
            </div>
        </div>
    </div>
  

    <div class="hastable">
    	<table class="tableData">
    <thead>
        <tr>
        	<th width="5%">ID</th>
            <th width="7%">Trang</th>
            <th width="7%">Nhu cầu</th>
            <th width="7%">Chủng loại</th>
            <th width="33%">Tiều để</th>  
            <th width="34%">Từ khóa</th>
            <th width="10%">Action</th>
        </tr>
    </thead>
    <tbody>
    <?php if (isset($getData)): 
	
		foreach($getData as $key=>$item){
		
		?>
		<tr id="row<?php echo $key ?>">
        	<td style="text-align:center;"><?php echo $key+1; ?></td>
            <td style="text-align:center;">
				<?php 
					if($item['id']==1){ 
						echo "Default";
					}else if($item['id']==2) {
						echo "Provinder";
					} else{
						echo $item['id'];
				} ?>
            </td>
            <td><?php if($item['id'] !=1 && $item['id']!=2){echo isset($item['needName'])? $item['needName']:'';} ?></td>
            <td><?php if($item['id']!=1 && $item['id']!=2){ echo isset($item['typeName'])?$item['typeName']:'';}  ?></td>
            <td><?php echo $item['title']; ?></td>   
            <td ><?php echo $item['keyword'] ?></td>
            <td style="text-align:center;">
            
             <a title="Sửa" href="<?php echo site_url('/admin/meta/edit/'.$item['id']);?>" class="btn_no_text btn ui-state-default ui-corner-all tooltip"><span class="ui-icon ui-icon-pencil"></span></a>
             <?php if($item['id'] !=1 && $item['id']!=2){ ?>
                <a title="Xóa" href="<?php echo site_url('/admin/meta/edit/'.$item['id'].'/index');?>" class="btn_no_text btn ui-state-default ui-corner-all tooltip"><span class="ui-icon ui-icon-trash"></span></a>
                <?php } ?>
            
            </td>
        </tr>
	 
	<?php } else: ?>

<tr>
<td colspan="3">There are no items</td>
</tr>

<?php endif; ?>
   
        
        </tbody>
</table>
    </div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery('#add').click(function(){
		var datafld = jQuery(this).attr('datafld');
		jQuery.ajax({
			type: "GET",
			dataType: "html",
			url: "<?php echo base_url('admin/district/add'); ?>",
			data: "",
			success: function(data){	
				jQuery('#submitDialog').html(data);
				jQuery('#submitDialog').dialog('open');
				//jQuery('.ui-dialog'
				return false;		
			}
		});			
	});
	
	jQuery('.edit').click(function(){
		var datafld = jQuery(this).attr('datafld');
		jQuery.ajax({
			type: "GET",
			dataType: "html",
			url: "<?php echo base_url('admin/district/edit'); ?>/"+datafld,
			data: "",
			success: function(data){	
				jQuery('#submitDialog').html(data);
				jQuery('#submitDialog').dialog('open');
				//jQuery('.ui-dialog'
				return false;		
			}
		});			
	});
});
</script>